package com.zxmzy.scaffold.core.ext

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

/**
 * @author zhangxiaoming
 * @date 2023/8/2
 * @description
 */
fun AppCompatActivity.startPage(clazz: Class<*>, block: (() -> Bundle)? = null) {
    val intent = Intent(this, clazz)
    block?.let {
        val bundle: Bundle = it.invoke()
        intent.putExtras(bundle)
    }
    this.startActivity(intent)
}